<% %>
<div id='project_tab'>
  <%=render :partial=>'project_tab'%>
</div>

<table class=data>
<%if @projects.empty?%>
<tr>
   <td><%='There no projects now.'.t%></td>
</tr>
<%else%>
<tr><th colspan=6></th></tr>
<%end%>
<% for @project in @projects %>
  <tr id="entry_<%=@project.id.to_s%>">
    <td colspan=6 style="border-bottom:0px">
     <h3 style="margin:0px;"><%=link_to @project.name,logs_url(@project)%></h3>
    </td>
  </tr>
  <tr>
     <td>
     <span class='intro_txt'>
      <%=@project.start_at.loc('%Y-%b-%d') if @project.start_at%> - <%=h @project.end_at.loc('%Y-%b-%d') if @project.end_at%>
      </span>
     </td>
    <td> <%='Project People'.t%>:[<%=h @project.users.size%>] </td>
    <td><%='Messages'.t%>:[<%=h @project.messages.size%>]</td>
    <td><%='Todos'.t%>:[<%=h @project.todos.size%>]</td>
    <td><%='End?'.t%>:
        <span id='chk_<%=@project.id%>'><%=check_box "project","completed",{:onclick=>remote_function(:loading=>"new Effect.Highlight('entry_#{@project.id}',{duration:5});Element.show('indicator_#{@project.id}');Element.hide('chk_#{@project.id}')",:url=>{:action=>'finish',:id=>@project.id})},"Yes","No"%></span>
	<span id='indicator_<%=@project.id%>' style='display:none'> <%=image_tag "indicator.gif",:border=>0%> </span>
    </td>
    <td class="action" align=right>
      <%=link_to "View".t,project_url(@project)%>
      <%= link_to 'Edit'.t, :action => 'edit', :id => @project %>
      <%= link_to_remote image_tag("trash.gif",:border=>0),
			    :loading => visual_effect(:highlight, "entry_#{@project.id}", :duration =>5),
	                    :url=>project_path(@project),
			    :method=>'delete',
			    :confirm => 'All data about this project will be detele'.t + "\n" +  'Are you sure?'.t%>
	</td>
  </tr>
<% end %>
<%if @project_pages.page_count > 1 %>
  <tr class=page><td colspan=8>
  <%= link_to '<<',:page => @project_pages.current.previous if @project_pages.current.previous %>
  <%=pagination_links( @project_pages )%>
  <%= link_to '>>',:page => @project_pages.current.next  if @project_pages.current.next %> 
  </td></tr>
<% end %>
<tr><td colspan=8 class=th>
 <%='Projects'.t%>:<%=@company.active_projects.size%> 
 <hr size=1>
 <%='Plan'.t%>:<%=@plan.name.t%>(
   <%='Projects'.t%>:<%=@plan.projects%>
 )
</td></tr>
</table>

